       <div class="table_machine">
       <table >
         <tr>
           <th>Nom machine</th>
           <th>Salle</th>
           <th>Adresse ip</th>
           <th>Connecté</th>
           <th>Incident</th>
               <th class="cellbouton"></th>
         </tr>
<% @machines.each do |machine| %>
		<% if machine.id%2 == 0 %>
	  		<tr class="impair" >
	  	<% else %>
	  		<tr class="pair" >
	  	<% end %>
	    <td><%= image_tag('computer.png') %>&nbsp;&nbsp;<%= link_to machine.nom_machine, machine %></td>
	    <% if machine.salle_id > 0 %>
	    	<td><%= link_to Salle.find_by_id(machine.salle_id).nom_salle.to_s, Salle.find_by_id(machine.salle_id) %></td>
	    <% else %>
	    	<td>N/A</td>
	    <% end %>
	    <td><%=h machine.adresse_ip %></td>
	    <td>
	    	<% if machine.ping == 1 %>
	    		<%= image_tag('connect.png', :alt => 'connect', :title => 'Machine connecté') %>
	    	<% else %>
	    		<%= image_tag('disconnect.png', :alt => 'disconnect', :title => 'Machine déconnecté') %>
	    	<% end %> 
	    </td>
	    <td>
	    	<% if Incident.getIncidentByMachine(machine.id) %>
				<%= link_to(image_tag('warning.png', :title => "Il y a un ou plusieurs accident(s) sur cette machine",:alt =>"incident", :height =>"16px", :width =>"16px" ), :controller => :incidents, :action => 'showByMachine', :id => machine.id ) %>
			<% end %>
	    </td>
	    <td style="width: 1000px;">
			<span class="bouton"><%= link_to 'Voir', machine %></span>
			<span class="bouton"><%= link_to 'Modifier', edit_machine_path(machine) %></span>
			<span class="delete"><%= link_to 'Supprimer', machine, :confirm => 'Etes vous sûr ?', :method => :delete %></span>
		</td>
	  </tr>
	<% end %>

	</table>
</div>
